Methods and apparatuses for detecting respiratory rate

ABSTRACT

This disclosure relates to methods and apparatus for detecting respiratory rate. The method for detecting respiratory rate may include: sampling respiratory waveform data in a time sequence; detecting respiratory cycles from the sampled respiratory waveform data; calculating variation degree for the sampled respiratory waveform data; calculating base length base on the variation degree; calculating smoothed length base on the base length; calculating real-time degree for each respiratory cycle base on the variation degree, sequence number of each respiratory cycle, and the smoothed length; and calculating respiratory rate base on the smoothed length and the real-time degree.

TECHNICAL FIELD

This disclosure relates generally to respiratory monitoring systems.Particularly, this disclosure relates to methods and apparatuses fordetecting respiratory rate in respiratory monitoring systems.

BACKGROUND

Respiratory rate is a common physiological parameter in physiologicalparameters monitoring that is usually measured via impedancepneumography. Respiratory rate is generally calculated by followingsteps: detecting peaks and valleys from received waveform, calculatingduration of each respiratory cycle and stacking the durations into anFIFO (First In, First Out) array, then averaging a number of durationsof recent respiratory cycles, where the number is restricted by anaccumulated time threshold.

The respiratory rate of a patient may change frequently, because thepatient's respiratory impedance can be sensitive to some externalfactors, such as movement, heart beat and the like. When the respiratoryrate of the patient changes from low to high (or from high to low) veryquickly and then enters into a relatively stable respiratory state, itis generally desirable that the respiratory rate detected by a patientmonitor could reflect the changing respiration trend in a timely manner.But conventional respiratory rate smoothing calculation method may notmeet such requirements satisfactorily, and specific problems can be asfollows.

1. The respiratory rate is calculated by averaging real-time respiratoryrates of several respiratory cycles without considering real-time changein the respiratory rate, so the result may not reflect real-timecondition; and

2. In conventional methods, the respiratory rate is calculated usingreal-time respiratory rates of the latest 12 respiratory cycles withoutfully considering the influence of respiratory cycles used, which maycause poor smoothness in the result, for example, sudden change canoccur in current respiratory rate when real-time respiratory waveform isinterfered.

SUMMARY

Disclosed herein are embodiments of methods and apparatuses fordetecting respiratory rate.

In one aspect, an method for detecting respiratory rate can include:

sampling respiratory waveform data in a time sequence;

detecting respiratory cycles from the sampled respiratory waveform data;

calculating variation degree for the sampled respiratory waveform data;

calculating base length based on the variation degree;

calculating smoothed length based on the base length;

calculating real-time degree for each respiratory cycle based on thevariation degree, sequence number of each respiratory cycle, and thesmoothed length; and calculating respiratory rate based on the smoothedlength and the real-time degree.

In another aspect, an apparatus for detecting respiratory rate caninclude:

a sampling module for sampling received respiratory waveform data in atime sequence;

a respiratory cycle detection module for detecting respiratory cyclesfrom the sampled respiratory waveform data;

a variation degree calculation module for calculating variation degreefor the sampled respiratory waveform data;

a base length calculation module for calculating base length based onthe variation degree;

a smoothed length calculation module for calculating smoothed lengthbased on the base length;

a real-time degree calculation module for calculating real-time degreeof each respiratory cycle based on the variation degree, sequence numberof corresponding respiratory cycle, and the smoothed length; and

a respiratory rate calculation module for calculating respiratory ratebased on the smoothed length and the real-time degree.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 shows a flow chart of a method for detecting respiratory rateaccording to an embodiment;

FIG. 2 shows a simulated diagram of relationship between real-timedegree and respiratory cycle according to the method for detectingrespiratory rate shown in FIG. 1;

FIG. 3 shows a simulated diagram of relationship between base length andthe latest respiratory rate according to the method for detectingrespiratory rate shown in FIG. 1;

FIG. 4 shows a simulated diagram of relationship between smoothed lengthand base length according to the method for detecting respiratory rateshown in FIG. 1;

FIG. 5 shows a simulated diagram of relationship between smoothed lengthand the latest respiratory rate according to the method for detectingrespiratory rate shown in FIG. 1;

FIG. 6 shows a simulated diagram of relationship between respiratoryrate and respiratory cycle according to the method for detectingrespiratory rate shown in FIG. 1;

FIG. 7 shows a schematic diagram of an apparatus for detectingrespiratory rate according to an embodiment.

DETAILED DESCRIPTION

In the disclosure, the respiratory rate can be calculated by averagingweighted respiratory rates corresponding to respiratory cycles withincertain time duration. Typically human respiration changes slowly andsometimes may experience external interference, which can cause poorsignal quality and a drastic change in real-time respiratory rate.Therefore, real-time respiratory rate often needs to be smoothed, andthe principle may be as follows:

1. Increase stability and reflect real-time degree for respiration withlarge variations;

2. Increase real-time degree and reflect respiratory rate change withinshort time duration for respiration with small variations;

3. Employ more respiratory cycles to perform averaging for respirationwith high respiratory rate, so as to enhance stability thereof;

4. Employ less respiratory cycles to perform averaging for respirationwith low respiratory rate, so as to enhance real-time degree thereof.

The method for detecting respiratory rate can include the followingsteps: sampling received respiratory waveform; detecting respiratorycycles; calculating variation degree; calculating variation factor;calculating base length; calculating smoothed length; and calculatingrespiratory rate. FIG. 1 is a flow chart showing the method fordetecting respiratory rate according to an embodiment, which may includethe following steps.

At step 1, received respiratory waveform data can be sampled within atime period in a time sequence to obtain a group of samples.

At step 2, respiratory cycles can be detected from the group of samples,which is the sampled respiratory waveform data. Specifically, step 2 mayinclude the following steps:

Firstly, for each respiratory cycle, whether the respiratory cycle issaturated can be evaluated: counting a time duration t in which a seriesof samples exceed a saturation threshold, if t is greater than a timethreshold, for example if t>0.2 s, then the corresponding respiratorycycle is set as saturated state, otherwise the corresponding respiratorycycle is set as unsaturated state.

Secondly, peaks and valleys can be detected from the group of samples:setting a detecting state, when the detecting state is valley searching,if a series of samples decrease continuously, then update valley valuein real time, and if the series of samples increase and the increasedrange (which is value of current sample minus valley value) exceeds arising threshold, which could be adjusted automatically in everyrespiratory cycle, then a valley is found and the detecting state ischanged to peak searching; when the detecting state is peak searching,if a series of samples increase continuously, then update peak value,and if the series of samples decrease and the decreased range (which isvalue of current sample minus peak value) exceeds a declining threshold,which could be adjusted automatically in every respiratory cycle, then apeak is found and the detecting state is changed to valley searching.The rising threshold and the declining threshold y can be updated asfollows:

$y = \{ {\begin{matrix}{{k*H},{x \leq \frac{T}{2}}} \\{{{( {k - \frac{1}{4}} )*H} - {\frac{H}{2\; T}*x}},{x > \frac{T}{2}}}\end{matrix},} $

where k is an empirical coefficient that can be within [½, 1], T is theduration of the previous respiratory cycle, H is the peak-to-valleyheight of the previous respiratory cycle, and x represents the samplingtime of a sample corresponding to a respiratory cycle.

Finally, the duration of the respiratory cycle can be obtained from thepeaks or valleys detected: the time difference between two adjacentpeaks or valleys is the duration of the respiratory cycle.

In addition, in order to improve smoothness further, after the durationof the respiratory cycle is calculated, step 2 can further include:

If the duration difference between the current and previous respiratorycycles is equal to or greater than a difference threshold and thecurrent respiratory cycles is saturated, the duration of the currentrespiratory cycle can be smoothed by the duration of the previousrespiratory cycle. Specifically, this can be realized as follows:

The duration of each respiratory cycle can respectively be recorded withtwo respiratory cycle arrays in chronological order. The first array canrecord the detected respiratory durations, while the second array canrecord the affirmed respiratory durations.

When the current respiratory cycle is saturated: if the differencebetween the durations of the current and previous respiratory cyclesrecorded in the first array is equal to or greater than a differencethreshold, then the duration of the previous respiratory cycle is usedas the duration of the current respiratory cycle, which is then recordedin the second array; if the difference between the durations of thecurrent and previous respiratory cycles recorded in the first array isless than the difference threshold, then the duration of the currentrespiratory cycle is recorded in the second array, and the saturationstatus can then be cleared. For all other situations, the duration ofthe current respiratory cycle can be recorded in the second array. Thedifference threshold can be chosen as 20%.

At step 3, variation coefficient and variation degree can be calculated.

Firstly, a set of variation coefficients can be calculated for the groupof samples. The variation coefficient between two adjacent samples cvcan be calculated by

${{cv} = \frac{{d\; 1} - {d\; 2}}{( {{d\; 1} + {d\; 2}} )/2}},$

where d1 and d2 are two samples, d1≧0, d2≧0 and d1 and d2 cannot be 0 atthe same time. For a group of samples s(N) (N is the number of samples),variation coefficient can be calculated for adjacent samples.

The variation coefficient is a relative value, which may reflect thechange between two adjacent samples:

If d1=d2, then cv=0, indicating there is no variation between the twoadjacent samples;

If d1 or d2 is equal to 0, then cv=2, indicating the largest changebetween the two adjacent samples;

If d1 is greater than d2, then cv>0, indicating d1 increases withrespect to d2 and the value of the variation coefficient cv can reflectthe amount of such increase; and

If d1 is less than d2, then cv<0, indicating d1 decreases with respectto d2 and the value of the variation coefficient cv can reflect theamount of such decrease.

Secondly, the variation degree for the group of samples is determined.Two critical values are provided: Icv is a smaller critical value andmcv is an intermediate critical value, where 0≦Icv<mcv<2. Numbers Icntand mcnt of the variation coefficients belonged to [0, Icv] and [0, mcv]is counted respectively.

Then, whether

$\frac{Icnt}{N}$

is greater than or equal to a first threshold (such as whether

$ {\frac{Icnt}{N} \geq {80\%}} ).$

If yes, the variation degree for the group of samples is considered low;otherwise, whether

$\frac{mcnt}{N}$

is greater than or equal to the first threshold (such as whether

$ {\frac{mcnt}{N} \geq {80\%}} ),$

if yes, the variation degree for the group of samples is consideredintermediate, otherwise the variation degree for the group of samples isconsidered high. In practical applications, the fist threshold may beadjusted to other values as required.

In the embodiment, a variation factor could be used to reflect thevariation degree for the group of samples. When the variation degree forthe group of samples is high, the variation factor n is 0; when thevariation degree of the group of samples is intermediate, the variationfactor n is 1; when the variation degree for the group of samples islow, the variation factor is 2.

At step 4, base length is calculated.

The value of the base length is adopted as the bigger one from areference cycles number and a minimum empirical period number during apredetermined time. Where the predetermined times corresponding todifferent variation degrees are different, specifically thepredetermined time is a first time period when the variation degree islow, the predetermined time is a second time period when the variationdegree is intermediate, the predetermined time is a third time periodwhen the variation degree is high, and the first time period<the secondtime period<the third time period; the reference cycles number is thenumber of respiratory cycles calculated base on the previous respiratoryrate and the predetermined time period; the minimum empirical periodnumber is a empirical value.

For example, the first time period is 10 s, the second time period is 15s and the third time period is 20 s. When the variation degree is lowand the minimum empirical period number is 5, the base length is MAX (5,10*the previous respiratory rate/60); when the variation degree isintermediate and the minimum empirical period number is 6, the baselength is MAX(6, 15* the previous respiratory rate/60); when thevariation degree is high and the minimum empirical period number is 7,the base length is MAX(7, 20* the previous respiratory rate/60).

The relationship between the previous respiratory rate and the baselength may be best depicted with a view in MATLAB, for example, as shownin FIG. 3, where n is a variation factor.

From the calculation of the base length, it can be seen that the baselength is related to the variation degree for the group of samples. Thebase length increases with the increase of the latest respiratory rate.And the higher the variation degree is, the faster the base lengthincreases with the increase of the latest respiratory rate.

The predetermined first, second and third time period could not be toolong or too short. A longer time period leads to slower change and alarger number of respiratory cycles; a shorter time period leads to afaster change and a smaller number of respiratory cycles.

At step 5, smoothed length is calculated.

It is defined that the relationship between the smoothed length and thebase length is given by the following equation:

${\sum\limits_{i = {{sl} - {bl} + 1}}^{sl}\; i^{n}} \geq {{th}_{2}*{\sum\limits_{i = 1}^{sl}\; i^{n}}}$

where i is the sequence number indicating the position of therespiratory cycle, n is the variation factor and n≧0, th₂ is a secondthreshold, bl represents the base length, sl represents the smoothedlength, and sl is the minimum integer satisfying the equation. Thesecond threshold th₂ could be 90% or other values as required.

Once the base length is determined, the smoothed length may becalculated. The relationship between the smoothed length and the baselength is best depicted with a view in MATLAB, for example, as shown inFIG. 4, where n is the variation factor.

The relationship between the previous respiratory rate and the smoothedlength is best depicted with a view in MATLAB, for example, as shown inFIG. 5, where n is the variation factor.

At step 6, real-time degree and the variation factor are calculated.

Firstly, real-time weight is determined. Each respiratory cyclecorresponds to a real-time weight, and the real-time weight and thesequence number of corresponding respiratory cycle is an exponentialrelationship. That is p(i)=i^(n), where p(i) is the real-time weight, iis the sequence number of corresponding respiratory cycle, and n is thevariation factor.

Then, the real-time degree is calculated. The real-time degree specifiesthe closeness between sampling time of the respiratory cycle and currenttime. A higher real-time degree indicates that the respiratory cycle hasa better real-time performance. The real-time degree rt(i) can becalculated by

${{{rt}(i)} = \frac{i^{n}}{\sum\limits_{i = 1}^{sl}\; i^{n}}},$

where i is the sequence number of corresponding respiratory cycle, asequence number indicating the position for a preceding respiratorycycle is smaller than a sequence number indicating the position for asubsequent respiratory cycle, n is the variation factor, n≧0, and sl isthe smoothed length.

Taking the latest 10 respiratory cycles as an example, Table. 1 belowlists the relationship between the real-time degree and the variationfactor.

TABLE 1 Sequence number 1 2 3 4 5 6 7 8 9 10 Time direction of Past-----------------------------------------> Now sequence number Real-timeweight 1 1 1 1 1 1 1 1 1 1 (variation factor = 0) Real-time degree 0.10.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 Real-time weight 1 2 3 4 5 6 7 8 910 (variation factor = 1) Real-time degree 0.018 0.036 0.054 0.072 0.090.109 0.127 0.145 0.163 0.181 Real-time weight 1 4 9 16 25 36 49 64 81100 (variation factor = 2) Real-time degree 0.002 0.01 0.023 0.041 0.0640.093 0.127 0.166 0.21 0.259

The above table may be best depicted with a view in MATLAB, for example,as shown in FIG. 2, where n is the variation factor.

It may be seen from the real-time degree calculation formula that thereal-time degree of a certain respiratory cycle is related to thevariation factor n and the sequence number. From the determination ofthe variation factor n and the sequence number of the respiratory cycle,it may be known that a sequence number indicating the position for apreceding respiratory cycle is smaller than a sequence number indicatingthe position for a subsequent respiratory cycle, and a higher variationdegree corresponds to a smaller variation factor n so that a mappingrelationship occurs between the real-time degree and the variationdegree. This relationship may be indicated with the variation factor.For respiratory cycles with a higher variation degree, a smallervariation factor is selected and the difference between real-timedegrees of respiratory cycles at different time sequence is smaller s,so that the calculated stability of the respiratory rate might increase.For respiratory cycles with a smaller variation degree, a largervariation factor is selected and the difference between real-timedegrees of respiratory cycles at different time sequence is large (thereal-time degree of a respiratory cycle which is closer to the currentmoment is higher), so that the instantaneity of the calculatedrespiratory rate could be increased. Thereby realizing increasingstability for respiratory cycles with larger variation and increasingreal-time degree for respiratory cycles with smaller variation degree.

At step 7, respiratory rate is calculated.

The respiratory rate may be calculated by:

${{rtav} = {\sum\limits_{i = 1}^{sl}\; {{{rr}(i)}*{{rt}(i)}}}};$

where rtav represents the respiratory rate, i is the sequence number ofthe respiratory cycle, rt(i) is the real-time degree of the i-threspiratory cycle, and rr(i) is the respiratory rate of the i-threspiratory cycle. The calculation of the smoothed respiratory rate maybe best depicted with a view in MATLAB, for example, as shown in FIG. 6,where n is the weighting factor.

As shown in FIG. 7, in one embodiment, an apparatus for detectingrespiratory rate may include a sampling module, a respiratory cycledetection module, a variation degree calculation module, a base lengthcalculation module, a smoothed length calculation module, a real-timedegree calculation module and a respiratory rate calculation module.

The sampling module samples received respiratory waveform data within atime period in a time sequence to obtain a group of samples.

The respiratory cycle detection module detects respiratory cycles fromthe group of samples, which may include a cycle saturation detectionunit for judging whether each respiratory cycle is saturatedrespectively; a peak-valley detection unit for detecting peaks andvalleys from the group of samples; and a respiratory cycle calculationunit for calculating duration of the respiratory cycle on the timedifference between two adjacent peaks or valleys.

In addition, the respiratory cycle detection module may further includea cycle smoothing unit for smoothing the current respiratory cycle bythe duration of the previous respiratory cycle if duration differencebetween the current and previous respiratory cycles is equal to or greatthan a difference threshold and the current respiratory cycle issaturated.

The variation degree calculation module calculates the variation degree,which may include a variation coefficient calculation unit, a countingunit and a judgment unit. The variation degree calculation unitcalculates a set of variation coefficients for the group of samples, andthe specific calculation method is the same as above method. Thecounting unit counts numbers Icnt and mcnt of variation coefficientbelonged to [0, Icv] and [0, mcv] respectively, where Icv is a smallercritical value, mcv is an intermediate critical value and 0≦Icv<mcv<2.The judgment unit judges whether

$\frac{Icnt}{N}$

is greater than or equal to a first threshold (such as whether

$ {\frac{Icnt}{N} \geq {80\%}} )\text{:}$

If yes, the variation degree for the group of samples is considered low;or further judges whether

$\frac{mcnt}{N}$

is greater than or equal to the first threshold (such as whether

$ {\frac{mcnt}{N} \geq {80\%}} ),$

if yes, the variation degree for the group of samples is consideredintermediate, or the variation degree for the group of samples isconsidered high.

In the embodiment, a variation factor could be used to represent thevariation degree. When the variation degree for the group of samples ishigh, the variation factor n is 0; when the variation degree for thegroup of samples is intermediate, the variation factor n is 1; when thevariation degree for the group of samples is low, the variation factoris 2.

The value of the base length is adopted as the bigger one from areference cycles number and a minimum empirical period number during apredetermined time, and the number of respiratory cycles calculated baseon the previous respiratory rate and the predetermined time period. Thespecific calculation method is the same as above method.

The smoothed length calculation module calculates smoothed length bycalculated base length. Specifically, the smoothed length calculationmodule calculates the smoothed length is calculated by:

${{\sum\limits_{i = {{sl} - {bl} + 1}}^{sl}i^{n}} \geq {{th}_{2}*{\sum\limits_{i = 1}^{sl}i^{n}}}};$

where i is the sequence number indicating the position of therespiratory cycle, n is the variation factor, th2 is a second threshold,bl is the base length, sl is the smoothed length, and sl is the minimuminteger satisfying the equation.

The real-time degree calculation module calculates real-time degree ofeach respiratory cycle base on the variation degree, sequence number ofeach respiratory cycle and the smoothed length. Specifically, thereal-time degree calculation module calculates the real-time degree ofeach respiratory cycle by:

${{r\; {t(i)}} = \frac{i^{n}}{\sum\limits_{i = 1}^{sl}i^{n}}};$

where i is the sequence number of the corresponding respiratory cycle, nis the variation factor, sl is the smoothed length and rt is thereal-time degree.

The respiratory rate calculation module calculates smoothed respiratoryrate base on the smoothed length and the real-time degree. Specifically,the smoothed length calculation module calculates the smoothed length iscalculated by:

${{\sum\limits_{i = {{sl} - {bl} + 1}}^{sl}i^{n}} \geq {{th}_{2}*{\sum\limits_{i = 1}^{sl}i^{n}}}};$

where i is the sequence number indicating the position of therespiratory cycle, n is the variation factor, th2 is a second threshold,bl is the base length, sl is the smoothed length, and sl is the leastinteger satisfying the equation.

In conclusion, for respiration with larger variations, using smallervariation degree and larger base length, stability of the respiratoryrate could be enhanced and timeless change could be reflected; forrespiration with smaller variations, using higher variation degree andless base length, the timeless change could be enhanced and respiratoryrate change could be reflected in shorter time; for respiration withlarger respiratory rate, use more respiratory cycles to do smoothingprocess, so as to enhance stability; for respiration with lowerrespiratory rate, use less respiratory cycles to do smoothing process,so as to reflect timeless change. In practical application, thestability and timeless change of the respiratory rate could be obtainedbetter overall results by the variation factor and the base length.

The foregoing specification has been described with reference to variousembodiments. However, one of ordinary skill in the art will appreciatethat various modifications and changes can be made without departingfrom the scope of the present disclosure. Accordingly, this disclosureis to be regarded in an illustrative rather than a restrictive sense,and all such modifications are intended to be included within the scopethereof. Likewise, benefits, advantages, and solutions to problems havebeen described above with regard to various embodiments and are not tobe construed as critical, required, or essential feature or element. Thescope of the present disclosure should, therefore, be determined by thefollowing claims.

What is claimed is:
 1. A method for detecting respiratory rate,comprising: A1. sampling respiratory waveform data in a time sequence;B1. detecting respiratory cycles from the sampled respiratory waveformdata; C1. calculating variation degree for the sampled respiratorywaveform data; D1. determining base length based on the variationdegree; E1. calculating smoothed length based on the base length; F1.calculating real-time degree for each respiratory cycle based on thevariation degree, sequence number of each respiratory cycle, and thesmoothed length; and G1. calculating respiratory rate based on thesmoothed length and the real-time degrees.
 2. The method of claim 1,wherein said B1 comprises: B11. for each respiratory cycle, whether therespiratory cycle is saturated can be evaluated; B12. detecting peaksand valleys from the sampled respiratory waveform data; B13. calculatingduration of the respiratory cycle base on the time difference betweentwo adjacent peaks or valleys detected in B12.
 3. The method of claim 2,wherein after said B13, said B1 further comprising: B14. if durationdifference between the current and previous respiratory cycles is equalto or greater than a difference threshold and the current respiratorycycle is saturated, the duration of the current respiratory cycle issmoothed by the duration of the previous respiratory cycle.
 4. Themethod of claim 1, wherein said C1 comprising: C11. calculating a set ofvariation coefficients for the sampled respiratory waveform data; C12.counting numbers Icnt and mcnt of variation coefficients belonged to [0,Icv] and [0, mcv] respectively, wherein Icv is a smaller critical value,mcv is an intermediate critical value, and 0≦Icv<mcv<2; C13. judgewhether $\frac{Icnt}{N}$ is greater than or equal to a first threshold:If yes, the variation degree is low; or further judge whether$\frac{mcnt}{N}$ is greater than or equal to the first threshold, ifyes, the variation degree is intermediate, or the variation degree ishigh, wherein N is the number of the sampled respiratory waveform data.5. The method of claim 4, wherein the first threshold is 80%.
 6. Themethod of claim 1, wherein the value of the base length is adopted asthe bigger one from a reference cycles number and a minimum empiricalperiod number during a predetermined time; wherein the predeterminedtime is a first time period when the variation degree is low, thepredetermined time is a second time period when the variation degree isintermediate, the predetermined time is a third time period when thevariation degree is high, and the first time period<the second timeperiod<the third time period.
 7. The method of claim 6, wherein saidreference cycles number is the number of respiratory cycles calculatedbase on the previous respiratory rate and the predetermined time period.8. The method of claim 1, wherein said smoothed length is calculated by:${{\sum\limits_{i = {{sl} - {bl} + 1}}^{sl}i^{n}} \geq {{th}_{2}*{\sum\limits_{i = 1}^{sl}i^{n}}}};$wherein i is the sequence number indicating the position of therespiratory cycle, n is the variation factor, th₂ is a second threshold,bl is the base length, sl is the smoothed length, and sl is the minimuminteger satisfying the equation; when the variation degree is high, thevariation factor n is 0; when the variation degree is intermediate, thevariation factor n is 1; when the variation degree is low, the variationfactor is
 2. 9. The method of claim 1, wherein said real-time degree ofeach respiratory cycle is calculated by:${{r\; {t(i)}} = \frac{i^{n}}{\sum\limits_{i = 1}^{sl}i^{n}}};$wherein i is the sequence number of the corresponding respiratory cycle,n is the variation factor, sl is the smoothed length and rt is thereal-time degree; when the variation degree is high, the variationfactor n is 0; when the variation degree is intermediate, the variationfactor n is 1; when the variation degree is low, the variation factor is2.
 10. The method of claim 1, said respiratory rate is calculated by:${rtav} = {\sum\limits_{i = 1}^{sl}{{{rr}(i)}*{{rt}(i)}}}$ whereinrtav is the respiratory rate, i is the sequence number of therespiratory cycle, rt(i) is the real-time degree of the i-th respiratorycycle, and rr(i) is the respiratory rate of the i-th respiratory cycle.11. An apparatus for detecting respiratory rate, comprising: a samplingmodule for sampling received respiratory waveform data in a timesequence; a respiratory cycle detection module for detecting respiratorycycles from the sampled respiratory waveform data; a variation degreecalculation module for calculating variation degree for the sampledrespiratory waveform data; a base length calculation module forcalculating base length base on the variation degree; a smoothed lengthcalculation module for calculating smoothed length base on the baselength; a real-time degree calculation module for calculating real-timedegree of each respiratory cycle base on the variation degree, sequencenumber of each respiratory cycle, and the smoothed length; and arespiratory rate calculation module for calculating respiratory ratebase on the smoothed length and the real-time degree.
 12. The apparatusof claim 11, wherein said respiratory cycle detection module comprising:a cycle saturation detection unit for judging whether each respiratorycycle is saturated respectively; a peak-valley detection unit fordetecting peaks and valleys from the sampled respiratory waveform data;and a respiratory cycle calculation unit for calculating duration of therespiratory cycle base on the time difference between two adjacent peaksor valleys.
 13. The apparatus of claim 12, wherein said respiratorycycle detection module further comprising: a cycle smoothing unit forsmoothing the current respiratory cycle by the duration of the previousrespiratory cycle if duration difference between the current andprevious respiratory cycle is equal to or greater than a differencethreshold and the current respiratory cycle is saturated.
 14. Theapparatus of claim 11, wherein said variation degree calculation modulecomprising: a variation coefficient calculation unit for calculating aset of variation coefficients for the sampled respiratory waveform data;a counting unit for counting numbers Icnt and mcnt of variationcoefficients belonged to [0, Icv] and [0, mcv] respectively, wherein Icvis a smaller critical value, mcv is an intermediate critical value, and0≦Icv<mcv<2; and a judgment unit for judging whether $\frac{Icnt}{N}$ isgreater than or equal to a first threshold: If yes, the variation degreeis low; or further judge whether $\frac{mcnt}{N}$ is greater than orequal to the first threshold, if yes, the variation degree isintermediate, or the variation degree is high, wherein N is the numberof the sampled respiratory waveform data.
 15. The apparatus of claim 11,wherein the value of the base length is adopted as the bigger one from areference cycles number and a minimum empirical period number during apredetermined time; wherein the predetermined time is a first timeperiod when the variation degree is low, the predetermined time is asecond time period when the variation degree is intermediate, thepredetermined time is a third time period when the variation degree ishigh, and the first time period<the second time period<the third timeperiod.
 16. The apparatus of claim 15, wherein said reference cyclesnumber is the number of respiratory cycles calculated base on theprevious respiratory rate and the predetermined time period.
 17. Theapparatus of claim 11, said smoothed length calculation modulecalculates the smoothed length is calculated by:${{\sum\limits_{i = {{sl} - {bl} + 1}}^{sl}i^{n}} \geq {{th}_{2}*{\sum\limits_{i = 1}^{sl}i^{n}}}};$wherein i is the sequence number indicating the position of therespiratory cycle, n is the variation factor, th₂ is a second threshold,bl is the base length, sl is the smoothed length, and sl is the minimuminteger satisfying the equation; when the variation degree is high, thevariation factor n is 0; when the variation degree is intermediate, thevariation factor n is 1; when the variation degree is low, the variationfactor is
 2. 18. The apparatus of claim 11, wherein said real-timedegree calculation module calculates the real-time degree of eachrespiratory cycle by:${{r\; {t(i)}} = \frac{i^{n}}{\sum\limits_{i = 1}^{sl}i^{n}}};$wherein i is the sequence number of the corresponding respiratory cycle,n is the variation factor, sl is the smoothed length and rt is thereal-time degree; when the variation degree is high, the variationfactor n is 0; when the variation degree is intermediate, the variationfactor n is 1; when the variation degree is low, the variation factor is2.
 19. The apparatus of claim 11, wherein said respiratory ratecalculation module calculates the smoothed respiratory rate by:${{rtav} = {\sum\limits_{i = 1}^{sl}{{{rr}(i)}*{{rt}(i)}}}};$ whereinrtav is the respiratory rate, i is the sequence number of therespiratory cycle, rt(i) is the real-time degree of the i-th respiratorycycle, and rr(i) is the respiratory rate of the i-th respiratory cycle.